1 using UnityEngine;
2 using
System.Collections;
3
4 public
class DetectScoring : MonoBehaviour {
5     
public int scorePerHit = 1;
6
7     
// Use this for initialization
8     
void Start () {
9     
10     }
11     
12     
// Update is called once per frame
13     
void Update () {
14     
15     }
16
17     
private void OnCollisionEnter(Collision collision)
18     {
19         ScoreKeeper scoreKeeper = FindObjectOfType<ScoreKeeper>();
20         scoreKeeper.IncrementScore(scorePerHit);
21     }
22 }


Gõ tìm kiếm nhanh...